//目标和

class Solution {
public:
    int ret;
    int target_;
    int findTargetSumWays(vector<int>& nums, int target) {
        target_ = target;
        int path;
        dfs(nums, 0, path);
        return ret;
    }
    void dfs(vector<int>& nums, int pos, int path)
    {
        if(pos == nums.size())
        {
            if(path == target_)
            {
                ret++;
            }
            return;
        }
        dfs(nums, pos + 1, path + nums[pos]);

        dfs(nums, pos + 1, path - nums[pos]);
    }
};